/*
* 本文件用来定义一些不应该出现的定义（不是最佳）
*/
#pragma once

#include "simu_800.h"
#include "ql_api_osi.h"
#include "ql_api_spi6_ext_nor_flash.h"

typedef char int8;
typedef short int16;
typedef int int32;
typedef long long int64;
typedef unsigned char uint8;
typedef unsigned short uint16;
typedef unsigned int uint32;
typedef unsigned long long uint64;

#define QL_HTTP_OK (0)
#define QL_GPIO_SUCCESS (0)

#define _ZQ_FILE_NAME (strrchr(__FILE__, '\\')+1)
#define QL_LOG(param1, param2, msg, ...) printf("ZQ:%s:%d:%s: "msg"\n",  _ZQ_FILE_NAME, __LINE__, __FUNCTION__, ##__VA_ARGS__)


extern int CheckFileIsExist(int* pexist);
extern QlOSStatus ql_rtos_queue_wait(ql_queue_t msgQRef, uint8* recvMsg, uint32 size, uint32 timeout);
extern QlOSStatus ql_rtos_queue_release(ql_queue_t msgQRef, uint32 size, uint8* msgPtr, uint32 timeout);
extern QlOSStatus ql_rtos_queue_create(ql_queue_t* msgQRef, uint32	maxSize, uint32 maxNumber);
extern QlOSStatus ql_rtos_queue_get_cnt(ql_queue_t msgQRef, uint32* cnt_ptr);
extern QlOSStatus ql_rtos_queue_get_free_cnt(ql_queue_t msgQRef, uint32* cnt_ptr);
extern QlOSStatus ql_rtos_queue_delete(ql_queue_t msgQRef);

extern void ql_spi6_ext_nor_flash_init(void);
extern ql_errcode_spi6_nor_e ql_spi6_ext_nor_flash_sffs_mount(void);
extern ql_errcode_spi6_nor_e ql_spi6_ext_nor_flash_sffs_mkfs(void);

extern int ql_nvm_fwrite(const char* config_file_name, void* buffer, size_t size, size_t num);
extern int ql_nvm_fread(const char* config_file_name, void* buffer, size_t size, size_t num);


